home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-03
/
qbasicpg.zip
/
BIKEINFO.BAS
< prev
next >
Wrap
BASIC Source File
|
1991-02-09
|
1KB
|
39 lines
' BIKEINFO.BAS
' This program reads information into three arrays and prints it.
CONST PERSONS% = 7 ' number of salespersons
OPTION BASE 1 ' set base of all arrays to 1
DIM salesGroup$(PERSONS%) ' dimension salesGroup$ string array
DIM bikesSold%(PERSONS%) ' dimension bikesSold% integer array
DIM totalSales!(PERSONS%) ' dimension totalSales! floating-point array
CLS
FOR i% = 1 TO PERSONS% ' get salesperson name and sales data
INPUT "Enter salesperson name: ", salesGroup$(i%)
INPUT " Bikes sold: ", bikesSold%(i%)
INPUT " Total sales: $", totalSales!(i%)
PRINT
total! = total! + totalSales!(i%)
NEXT i%
PRINT "You entered the following sales data:"
PRINT
PRINT "Salesperson Bikes sold Total sales"
PRINT "------------------------------------------"
PRINT
' initialize tmp$, a formatting template for PRINT USING
tmp$ = "\ \ ### $$####.##"
FOR i% = 1 TO PERSONS% ' print contents of each array
PRINT USING tmp$; salesGroup$(i%); bikesSold%(i%); totalSales!(i%)
NEXT i%
to$ = " The total sales are $$###.##"
PRINT
PRINT
PRINT USING to$; total!